<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>修改</title>
    <link href="../../assets/bootstrap.css" rel="stylesheet">
    <link href="../../assets/main.css" rel="stylesheet">
</head>
<body>
<form class="form-horizontal" id="editForm">
    <div class="form-group">
        <label for="name" class="col-sm-2 control-label">* 学生姓名</label>
        <div class="col-sm-4">
            <input type="text" class="form-control" id="name" placeholder="请输入" pattern="^\S.*$" title="不允许包含空格" required >
        </div>
    </div>
    <div class="form-group">
        <label for="sex" class="col-sm-2 control-label">学生性别</label>
        <div class="col-sm-4">
            <select class="form-control"  id="sex" >
                <option value="1">男</option>
                <option value="0">女</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="typeId" class="col-sm-2 control-label">* 学生学历</label>
        <div class="col-sm-4">
            <select class="form-control"  id="typeId" >
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="birthday" class="col-sm-2 control-label">* 学生生日</label>
        <div class="col-sm-4">
            <input type="date" class="form-control" id="birthday"   required >
        </div>
    </div>
    <div class="form-group">
        <label for="content" class="col-sm-2 control-label">备注</label>
        <div class="col-sm-10">
            <textarea class="form-control" id="content" placeholder="请输入" ></textarea>
        </div>
    </div>
    <input type="text" style="display: none" id="id">

</form>
<script src="../../assets/jquery.js"></script>
<script src="../../assets/bootstrap.js"></script>
<script>
    getTypeList();
    function getTypeList() {
        $.ajax({
            url: "/api/typeList?name=",
            type: "GET",
            success: function(data) {
                // 遍历数据，生成选项并添加到下拉框中
                data.forEach(function(item) {
                    $('#typeId').append('<option value="' + item.id + '">' + item.name + '</option>');
                });
            },
            error: function(xhr, status, error) {
                console.error("Error: ", error);
            }
        });
    }
</script>
</body>
</html>
